﻿using System.Collections.Generic;
using SpiceNet.Circuits;

namespace SpiceNet.Models
{
    /// <summary>
    /// A model for inductors
    /// </summary>
    public class InductorModel : Model
    {
        /// <summary>
        /// No parameters
        /// </summary>
        public override Dictionary<string, IP> ParamTable => null;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name"></param>
        public InductorModel(string name) : base(name) { }

        /// <summary>
        /// Load all circuit instances
        /// </summary>
        /// <param name="ckt"></param>
        public override void Load(Circuit ckt)
        {
            CircuitState state = ckt.State;
            int pass = 0;

            // First pass: Inductors shared initialization
            // Second pass: Mutual inductances
            // Third pass: Inductors finish
            for (pass = 0; pass < 3; pass++)
            {
                foreach (var inst in Instances)
                    inst.Load(ckt, this, pass);
            }
        }
    }
}
